//
//  SEGPayLogDetailHeadView.m
//  ExcellentHome
//
//  Created by 刘山 on 16/12/14.
//  Copyright © 2016年 陈区. All rights reserved.
//

#import "SEGPayLogDetailHeadView.h"

@implementation SEGPayLogDetailHeadView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    self.backgroundColor = kColor_W;

    //支付方式
    [self addSubview:self.contentLabel];
    [self setAttrWithSize:13 Color:kColor_3 lines:1 ForLabel:self.contentLabel];

    //缴费记录
    [self addSubview:self.contentLabel1];
    [self setAttrWithSize:13 Color:kColor_1 lines:1 ForLabel:self.contentLabel1];
    self.contentLabel1.text = @"共缴费：";
    [self addSubview:self.contentLabel2];
    [self setAttrWithSize:13 Color:kColor_1 lines:1 ForLabel:self.contentLabel2];

    //缴费时间
    [self addSubview:self.contentLabel3];
    [self setAttrWithSize:13 Color:kColor_1 lines:1 ForLabel:self.contentLabel3];
    self.contentLabel3.text = @"缴费时间：";
    [self addSubview:self.contentLabel4];
    [self setAttrWithSize:13 Color:kColor_1 lines:1 ForLabel:self.contentLabel4];

    //缴费房间
    [self addSubview:self.contentLabel5];
    [self setAttrWithSize:13 Color:kColor_1 lines:1 ForLabel:self.contentLabel5];
    self.contentLabel5.text = @"缴费房间：";
    [self addSubview:self.contentLabel6];
    [self setAttrWithSize:13 Color:kColor_1 lines:2 ForLabel:self.contentLabel6];

    [self.contentLabel sizeToFit];
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker* make) {
        make.right.equalTo(self).mas_offset(-15);
        make.top.equalTo(self).mas_offset(15);
    }];

    //缴费记录
    [self.contentLabel1 sizeToFit];
    [self.contentLabel1 mas_makeConstraints:^(MASConstraintMaker* make) {
        make.left.equalTo(self).mas_offset(15);
        make.top.equalTo(self).mas_offset(15);
    }];

    [self.contentLabel2 sizeToFit];
    [self.contentLabel2 mas_makeConstraints:^(MASConstraintMaker* make) {
        make.left.equalTo(self).mas_offset(65 + 15);
        make.centerY.equalTo(self.contentLabel1);
    }];

    //缴费时间
    [self.contentLabel3 sizeToFit];
    [self.contentLabel3 mas_makeConstraints:^(MASConstraintMaker* make) {
        make.left.equalTo(self).mas_offset(15);
        make.top.equalTo(self.contentLabel1.mas_bottom).mas_offset(15);
    }];

    [self.contentLabel4 sizeToFit];
    [self.contentLabel4 mas_makeConstraints:^(MASConstraintMaker* make) {
        make.left.equalTo(self).mas_offset(65 + 15);
        make.centerY.equalTo(self.contentLabel3);
    }];

    //缴费房间
    [self.contentLabel5 sizeToFit];
    [self.contentLabel5 mas_makeConstraints:^(MASConstraintMaker* make) {
        make.left.equalTo(self).mas_offset(15);
        make.top.equalTo(self.contentLabel3.mas_bottom).mas_offset(15);
    }];

    [self.contentLabel6 sizeToFit];
    [self.contentLabel6 mas_makeConstraints:^(MASConstraintMaker* make) {
        make.left.equalTo(self).mas_offset(65 + 15);
        make.right.equalTo(self).mas_offset(-15).priorityHigh();
        make.top.equalTo(self.contentLabel5.mas_top);
    }];
}

- (void)setAttrWithSize:(CGFloat)size Color:(UIColor*)color lines:(NSInteger)line ForLabel:(UILabel*)lb
{
    [lb setFont:[UIFont systemFontOfSize:size]];
    [lb setTextColor:color];
    lb.numberOfLines = line;
}

#pragma mark - lazy load

- (UILabel*)contentLabel
{
    if (!_contentLabel) {
        _contentLabel = [[UILabel alloc] init];
    }
    return _contentLabel;
}

- (UILabel*)contentLabel1
{
    if (!_contentLabel1) {
        _contentLabel1 = [[UILabel alloc] init];
    }
    return _contentLabel1;
}
- (UILabel*)contentLabel2
{
    if (!_contentLabel2) {
        _contentLabel2 = [[UILabel alloc] init];
    }
    return _contentLabel2;
}
- (UILabel*)contentLabel3
{
    if (!_contentLabel3) {
        _contentLabel3 = [[UILabel alloc] init];
    }
    return _contentLabel3;
}
- (UILabel*)contentLabel4
{
    if (!_contentLabel4) {
        _contentLabel4 = [[UILabel alloc] init];
    }
    return _contentLabel4;
}
- (UILabel*)contentLabel5
{
    if (!_contentLabel5) {
        _contentLabel5 = [[UILabel alloc] init];
    }
    return _contentLabel5;
}
- (UILabel*)contentLabel6
{
    if (!_contentLabel6) {
        _contentLabel6 = [[UILabel alloc] init];
    }
    return _contentLabel6;
}
@end
